#include "attrSync.h"


using namespace std;

class Player334 //应用例子
{

	std::unordered_map<AttrTypeUint32, uint32> dirtyMapUint32;
	std::unordered_map<AttrTypeUint64, uint64> dirtyMapUint64;
	SyncUint32 a1;
    SyncUint32Array<(int32)AttrTypeUint32::FIGHT_MAX> ata;

	 SyncUint64 a2;
	 SyncUint32Array<3> ar;
	 SyncUint64Array<3> ar3;
	 SyncUint64Array<3> ar4;
	Player334()
		:a1(AttrTypeUint32::FIGHT_MAX, dirtyMapUint32)
		,ata({AttrTypeUint32::HP, AttrTypeUint32::MANA, AttrTypeUint32::DEF}, dirtyMapUint32)
		,a2(AttrTypeUint64::STR, dirtyMapUint64)
		,ar({AttrTypeUint32::STR}, dirtyMapUint32)
		,ar3({AttrTypeUint64::STR}, dirtyMapUint64)
		,ar4()
	{
		ar4.Init(AttrTypeUint64::T1, dirtyMapUint64);
	}

	void ModfyAttr()
	{
		a1 = 3;
		int32 c2 = a1;

		ata[AttrTypeUint32::HP] = 3;
		c2 = ata[AttrTypeUint32::HP]+ c2;

		a2 = 0xffffffffff;
		uint64 c64 = a2;

		c2 = ar[AttrTypeUint32::HP];

		SyncUint32 t1;
		if(t1==a1 || t1 > a2)
		{}
		++a1;
		--a1;
		a1+=3;

	}

	void update()
	{
		if (!dirtyMapUint32.empty())
		{
			for (auto&& [k, v] : dirtyMapUint32)
			{
				//notify type, value
				//sync to client
			}
		}
	}
};
   